<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>bootstrap modal插件封装</title>
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/b-modal.css">
</head>
<body>
   <button class="btn btn-primary btn-info">点击弹框</button>
   <button class="btn btn-primary btn-confirm" data-toggle="modal"  data-target="#myModal" data-keyboard="false">点击弹出确认框</button>
   <button class="btn btn-primary btn-alert">点击弹出警告框</button>
   <div class="b-info"></div>
   <div class="b-confirm"></div>
   <div class="b-alert"></div>
</body>
<script src="../js/jquery.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<script src="../js/b-modal.js"></script>
<script>
$(function(){
    // alert
    $(".btn-info").click(function () {
        _alert();
    });
    // confirm
    $(".btn-confirm").click(function(){
        _confirm();
    })
});
// 定义弹框
let _alert = () => {
  $(".b-info").html(new Bootstrap('','请输入内容').Info(5))
};
// 定义确认框
let _confirm = () => {
    $(".b-confirm").html(new Bootstrap("删除确认","确认删除吗?" ,['取消','确认']).Confirm('.btn-confirm'));
};

</script>
</html>